      SUBROUTINE NUMCSE
C     COMPUTES NUMBER OF CONTROL SYSTEM EQUATIONS & MAP OF CONTROL VARIA
C
      COMMON /ICNTRL/KNTRL(10)
C
      COMMON/IMAIN1/ IDATE,LSAVE,INOPT,IPLOT,NUMEQS,IPLTPE,IORB,ITAPE
C
      COMMON /JCNTRL/NCNTRL,MCNTRL,MAPCNT(20)
C     MARK START OF CONTROL EQUATIONS
C
      MCNTRL=NUMEQS
C     START WITH
C     2ND ORDER SENSOR SENSOR MODEL
      MAPCNT(1)=1
      MAPCNT(2)=2
      NCNTRL=2
      IF(KNTRL(1) .LT. 2) GO TO  200
C      UPGRADE TO 4TH ORDER MODEL
      MAPCNT(3)=3
      MAPCNT(4)=4
      NCNTRL=4
C
C      ADD EQUATIONS FOR WHEEL SPEED, PITCH COMPENSATION AMPLIFIER
200   NCNTRL=NCNTRL+1
      MAPCNT(NCNTRL)=15
      NCNTRL=NCNTRL+1
      MAPCNT(NCNTRL)=11
C
C     CHECK FOR NUTATION DAMPER
      IF(KNTRL(2) .EQ. 0) GO TO 300
C     NUTATION DAMPER PHASE SHIFT CIRCUIT
      NCNTRL=NCNTRL+1
      MAPCNT(NCNTRL)=19
      NCNTRL=NCNTRL+1
      MAPCNT(NCNTRL)=20
C
C     NOW FOR THE ROLL SENSOR
      NCNTRL=NCNTRL+1
      MAPCNT(NCNTRL)=6
      NCNTRL=NCNTRL+1
      MAPCNT(NCNTRL)=7
C      USE SAME ORDER AS IN PITCH
      IF(KNTRL(1) .LT. 2) GO TO 300
      NCNTRL=NCNTRL+1
      MAPCNT(NCNTRL)=8
      NCNTRL=NCNTRL+1
      MAPCNT(NCNTRL)=9
C
C     CHECK FOR TACHOMETER DYNAMICS
300   IF(KNTRL(3) .EQ. 0) GO TO 400
      NCNTRL=NCNTRL+1
      MAPCNT(NCNTRL)=13
400   NUMEQS=NUMEQS+NCNTRL
      RETURN
      END
